using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using RecruitmentSystem.Business;
using RecruitmentSystem.Common;
using System.Collections.Generic;


public partial class Share_UserControl_EnterpriseInfoLeft : System.Web.UI.UserControl
{
    private int enterpriseId = 0;
    public int EnterpriseId
    {
        set { enterpriseId = value; }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (enterpriseId != 0)
            {
                BindPositionList();
                hlEnterpriseUrl.NavigateUrl = "~/EnterpriseDetails.aspx?eid=" + enterpriseId;
            }
        }
    }

    private void BindPositionList()
    {
        JobManager jm = new JobManager();
        List<JobPosition> jps = new List<JobPosition>();
        jps = jm.GetJobsById(enterpriseId, UserType.EnterpriseUser, PositionStatus.Activity, 15, 1);
        blPositionList.DataSource = jps;
        blPositionList.DataTextField = "title";
        blPositionList.DataBind();
        for (int i = 0; i < jps.Count;i++ )
        {
            blPositionList.Items[i].Value = "~/PositionDetails.aspx?pid=" + jps[i].Id + "&eid=" + enterpriseId;
            blPositionList.Items[i].Attributes.Add("style", "padding-bottom:5px");
        }
    }
}
